<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html style='height:100%;'>
  <head>
    <base href="<%=basePath%>">
    
    <title>总建筑面积</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" href="css/vivo.css">
	<link rel="stylesheet" href="css/bootstrap.css">
	<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
	<link rel="stylesheet" href="css/common.css">
	<link rel="stylesheet" href="js/font-awesome/css/font-awesome.css">
    <link href="js/select2/select2.min.css" type="text/css" rel="stylesheet" />
	<link rel="stylesheet" type="text/css" href="static/p_house/house_index.css" />
	
	<script src="js/jquery-1.11.1.js"></script>
	<script src="js/bootstrap2/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script> 
	<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script> 
	<script src="js/select2/select2.min.js"></script>
    <script type="text/javascript" src="js/sharefunction.js"></script>
	<style type="text/css">
		.style_input {
			padding-left: 10px;
		}
		
		table {
			border-collapse: collapse
		}
		
		tr {
			border: 0px solid gray;
			height: 35px
		}
		
		.style_box {
			border: 1px solid gray;
			padding: 10px 0px;
			margin-left:22px;
		}
		.cannotChange{
			readonly:readonly;
		}
	</style>
</head>
<script src="js/form.js"></script>
<script type="text/javascript">
	$(function(){
		mySubmit("totalScaleAdd", initFormData, successParkk);
	})
	var opt;
	//opt操作字段，0：临时保存；1：新增；2：修改
	function saveTotalScale(val){
		opt=val;
		if(val==3){
			//解除锁定状态
			var index=layer.confirm('确定开启编辑状态？', {
			 	offset:'20%',
				shade:0
			}, function(){
			  //去除只读开启按钮编辑
			   //$("#totalScaleAdd").find("input:not(.cannotChange),textarea:not(.cannotChange)").attr("readonly",false);
			   $("#totalScaleAdd").find("input,textarea").attr("readonly",false);
			   $("#totalScaleAdd #modifyBtn").remove();
			   $("#totalScaleAdd .hidbtn").removeClass("hidbtn");
			   $("#totalScaleAdd .icon-fullscreen").show();
			   $("#totalScaleAdd .addbtn").attr("disabled",false);
			   //建筑总面积设置只读
			   //$("input[name='buildingArea']").attr("readonly",true);
			   layer.close(index);
			});
		}else{
			$("#totalScaleAdd").submit();
		}
	}
	
	var ti;
	//封装表单数据为json
	function initFormData() {
		ti = layer.load(2);
		var groundUseArea = $("#entityId_groundUseArea").val();
		var undergroundUseArea = $("#entityId_undergroundUseArea").val();
		var fkProjectid = parent.parent.projectID;
		//封装地上用途数据
		var $t = $("#ground tr:gt(0)");//找到用途数据
		var ground = new Array();
		for(var i=0;i<$t.length;i++){
			var v=$t[i];
			var area = $(v).find("input[name='area']").val();
			var name1 = $(v).find("input[name='name1']").val();
			var gid= $(v).find("input[name='gId']").val();
			if (!valLength(20,name1)) {
				layer.msg("地上面积中第" + (i + 1) + "行用途名称长度不能超过20");
				$(v).find("input[name='name1']")[0].focus();
				layer.close(ti);
				return null;
			}else if (!testNum(area)) {
				layer.msg("地上面积中第" + (i + 1) + "行用途面积请输入数值");
				$(v).find("input[name='area']")[0].focus();
				layer.close(ti);
				return null;
			}
			ground.push({
				area : area,
				ause : name1,
				id : gid,
				fkBuilding:groundUseArea
			});
		}
		//封装地下用途数据
		var $t = $("#underground tr:gt(0)");//找到用途数据
		var underground = new Array();
		for(var i=0;i<$t.length;i++){
			var v=$t[i];
			var area = $(v).find("input[name='area']").val();
			var name1 = $(v).find("input[name='name1']").val();
			var uid= $(v).find("input[name='ugId']").val();
			if (!valLength(20,name1)) {
				layer.msg("地下面积中第" + (i + 1) + "行用途名称长度不能超过20");
				$(v).find("input[name='name1']")[0].focus();
				layer.close(ti);
				return null;
			}else if (!testNum(area)) {
				layer.msg("地下面积中第" + (i + 1) + "行用途面积请输入数值");
				$(v).find("input[name='area']")[0].focus();
				layer.close(ti);
				return null;
			}
			underground.push({
				area : area,
				ause : name1,
				id : uid,
				fkBuilding:undergroundUseArea
			});
			
		}
		var absid= $("#entityId_absid").val();
		var otherArea = $("#totalScaleAdd #otherArea").val();
		var buildingArea = $("input[name='buildingArea']").val();
		var groundArea = $("input[name='groundArea']").val();
		var groundPublicArea = $("input[name='groundPublicArea']").val();
		var undergroundArea = $("input[name='undergroundArea']").val();
		var undergroundPublicArea = $("input[name='undergroundPublicArea']").val();
		var gardenArea = $("input[name='gardenArea']").val();
		var gardenBuildingArea = $("input[name='gardenBuildingArea']").val();
		var gardenGroveArea = $("input[name='gardenGroveArea']").val();
		var gardenAisleArea = $("input[name='gardenAisleArea']").val();
		var gardenParkArea = $("input[name='gardenParkArea']").val();
		//获取地上面积下所有用途面积之和，确保面积之和小于等于地上面积
		var groundAreaArray = $("#totalScaleAdd #ground").find("input[name='area']");
		var groundAreaSum=parseFloat($("#totalScaleAdd #ground").find("input[name='groundPublicArea']").val());
		var groundUserArea=0;//地上用途面价之和
		$.each(groundAreaArray,function(index,value){
			groundAreaSum+=parseFloat($(value).val());
			groundUserArea+=parseFloat($(value).val());
		})
		//获取地下面积下所有用途面积之和，确保面积之和小于等于地上面积
		var underGroundAreaArray = $("#totalScaleAdd #underground").find("[name='area']");
		var underGroundUseArea = 0;//地下用途面积之和
		var underGroundAreaSum=parseFloat($("#totalScaleAdd #underground").find("input[name='undergroundPublicArea']").val());
		$.each(underGroundAreaArray,function(index,value){
			underGroundAreaSum+=parseFloat($(value).val());
			underGroundUseArea+=parseFloat($(value).val());
		});
		//获取园林面积之和
		var gardenAreaSum=parseFloat(gardenBuildingArea)+parseFloat(gardenGroveArea)+parseFloat(gardenAisleArea)+parseFloat(gardenParkArea);
		if (!testNum(groundArea)) {
			layer.msg("地上面积请输入数值");
			$("input[name='groundArea']").focus();
			layer.close(ti);
			return null;
		} 
		else if (!testNum(groundPublicArea)) {
			layer.msg("地上公共区域面积请输入数值");
			$("input[name='groundPublicArea']").focus();
			layer.close(ti);
			return null;
		}
		else if (!testNum(undergroundArea)) {
			layer.msg("地下面积请输入数值");
			$("input[name='undergroundArea']").focus();
			layer.close(ti);
			return null;
		} else if (!testNum(undergroundPublicArea)) {
			layer.msg("地下公共区域面积请输入数值");
			$("input[name='undergroundPublicArea']").focus();
			layer.close(ti);
			return null;
		} else if (!testNum(gardenArea)) {
			layer.msg("园区面积请输入数值");
			$("input[name='gardenArea']").focus();
			layer.close(ti);
			return null;
		} else if (!testNum(gardenBuildingArea)) {
			layer.msg("园区建筑面积请输入数值");
			$("input[name='gardenBuildingArea']").focus();
			layer.close(ti);
			return null;
		} else if (!testNum(gardenGroveArea)) {
			layer.msg("园区园林面积请输入数值");
			$("input[name='gardenGroveArea']").focus();
			layer.close(ti);
			return null;
		} else if (!testNum(gardenAisleArea)) {
			layer.msg("园区通道面积请输入数值");
			$("input[name='gardenAisleArea']").focus();
			layer.close(ti);
			return null;
		} else if (!testNum(gardenParkArea)) {
			layer.msg("园区停车面积请输入数值");
			$("input[name='gardenParkArea']").focus();
			layer.close(ti);
			return null;
		}
		//物业录的数据尚不完善，暂时先注释掉,后期数据完善后再添加该功能，切记勿删！！！！！！！！
		/* else if (underGroundUseArea>undergroundPublicArea) {
			$("input[name='undergroundPublicArea']").focus();
			layer.msg("地下用途面积之和应小于地下公共区域面积");
			layer.close(ti);
			return null;
		}
		else if (groundUserArea>groundPublicArea) {
			$("input[name='groundPublicArea']").focus();
			layer.msg("地上用途面积之和应小于地上公共区域面积");
			layer.close(ti);
			return null;
		}
		 */
		else if (parseFloat(groundPublicArea)>parseFloat(groundArea)) {
			$("input[name='groundPublicArea']").focus();
			layer.msg("地上公共区域面积之和应小于地上总面积");
			layer.close(ti);
			return null;
		}else if (parseFloat(undergroundPublicArea)>parseFloat(undergroundArea)) {
			$("input[name='undergroundPublicArea']").focus();
			layer.msg("地下公共区域面积之和应小于地下总面积");
			layer.close(ti);
			return null;
		}
		//物业录的数据尚不完善，暂时先注释掉,后期数据完善后再添加该功能，切记勿删！！！！！！！！
		/* else if (gardenArea<gardenAreaSum) {
			layer.msg("园区分块面积之和应小于园区总面积");
			layer.close(ti);
			return null;
		} */
		else if (!testNum(otherArea)) {
			$("#totalScaleAdd #otherArea").focus();
			layer.msg("其他请输入数值");
			layer.close(ti);
			return null;
		} else {
			return {
				id:absid,
				opt:opt,
				buildingArea : buildingArea,
				groundArea : groundArea,
				//groundPublicName : groundPublicName,
				groundPublicArea : groundPublicArea,
				undergroundArea : undergroundArea,
				undergroundPublicArea : undergroundPublicArea,
				//undergroundPublicName : undergroundPublicName,
				gardenArea : gardenArea,
				gardenBuildingArea : gardenBuildingArea,
				gardenGroveArea : gardenGroveArea,
				gardenAisleArea : gardenAisleArea,
				gardenParkArea : gardenParkArea,
				groundAreaUse : ground,
				undergroundAreaUse : underground,
				fkProjectid : fkProjectid,
				delIds : delIds,
				otherArea:otherArea
			};
		}
	}
	

	//成功后调用方法
	function successParkk(responseText) {
		layer.close(ti);
		if(responseText.msg=="success"){
        	//layer.msg("保存成功！");
        	layer.alert('保存成功！',{
				offset:'20%',
				shade:0
			},function(){
				location.reload();
				layer.close(ti);
			});
		}else{
			alert('保存失败！');
			layer.closeAll();
		}
	}
</script>
<body>
<form id="totalScaleAdd" method="post" action="buildingScale/addBuildingScale">
	<div style="padding:0px 20px">

		<div class="panel panel-default">
			<div class="panel-heading">
				<h5 class="panel-title">基本信息</h5>
			</div>
			<div class="panel-body">
				<div>
					<p>
						<span class="style_btn">建筑面积</span> <b class="style_input"><input
							type="type" id="" name="buildingArea" value="<fmt:formatNumber value="${abScale.buildingArea }" pattern="0.00"/>"/><span style="font-weight: normal;"> ㎡</span></b>
					</p>
					<p style="margin-left: 22px;margin-top: 20px;">
						<span class="style_btn">地上面积</span> <b class="style_input"><input class="cannotChange"
							type="type" id="" name="groundArea" value="<fmt:formatNumber value="${abScale.groundArea}" pattern="0.00"/>" /><span style="font-weight: normal;"> ㎡</span></b>
					</p>
				</div>
				<!-- 地上面积 -->
				<div class="style_box">
					<table cellpadding="10" cellspacing="5" class="mytable" id="ground">
						<tr>
							<td width="70" class="td-right"><span>公共区域</span></td>
							<td colspan="3"><input type="type"  class="cannotChange" name="groundPublicArea" value="<fmt:formatNumber value="${abScale.groundPublicArea}" pattern="0.00"/>" />㎡
								&nbsp;&nbsp;&nbsp;&nbsp; 
								<a class="btn btn-danger radius addbtn" id="addUse1" onclick="addTrUse(this)"> 添加用途</a>
							</td>
							<%-- <td width="70"><span>面积</span></td>
							<td colspan="3"><input type="type" id=""
								name="groundPublicArea" value="${abScale.groundPublicArea}" /> ㎡&nbsp;&nbsp;&nbsp;&nbsp; </td> --%>
						</tr>
						<!-- 暂时注释掉 -->
						<%-- <tr>
							<td width="70" class="td-right"><span>楼梯面积</span></td>
							<td><input type="type" class="cannotChange" name="groundStairs" value="<fmt:formatNumber value="${abScale.groundStairs}" pattern="0.00"/>"/>㎡
							</td>
							<td width="70" class="td-right"><span>大堂面积</span>
							<td><input type="type" class="cannotChange" name="groundLobby" value="<fmt:formatNumber value="${abScale.groundLobby}" pattern="0.00"/>"/>㎡
							</td>
						</tr>
						
						<tr>
							<td width="70" class="td-right"><span>平台面积</span></td>
							<td><input type="type" class="cannotChange" name="groundTerrace" value="<fmt:formatNumber value="${abScale.groundTerrace}" pattern="0.00"/>"/>㎡
							</td>
							<td width="70" class="td-right"><span>楼道面积</span>
							<td><input type="type" class="cannotChange" name="groundCorridor" value="<fmt:formatNumber value="${abScale.groundCorridor}" pattern="0.00"/>"/>㎡
							</td>
						</tr>  --%>
						
						<c:if test="${not empty requestScope.abScale.groundAreaUse }">
		 					<c:forEach var="item" items="${requestScope.abScale.groundAreaUse}" varStatus="index">
								<tr>
									<td width="70" class="td-right"><span>用途</span></td>
									<td width="320"><input type="type" name="name1"value="${item.ause}" /></td>
									<td width="70" class="td-right"><span>面积</span>
									<td><input type="type"name="area"value="<fmt:formatNumber value="${item.area}" pattern="0.00"/>"/>㎡
										<input type="hidden" id="entityId_gId" name="gId" value="${item.id}"/>
										<a data-id="${item.id}" href="javascript:void(0)"onclick="delTrUse(this)"><i class="icon-fullscreen"></i></a>
									</td>
								</tr>
							</c:forEach>
						</c:if>
					</table>
				</div>
				<!-- 地下面积 -->
				<div style="margin:20px 0px">
					<p style="margin-left:22px;">
						<span class="style_btn">地下面积</span> <b class="style_input"><input  class="cannotChange"
							type="type" id="" name="undergroundArea" value="<fmt:formatNumber value="${abScale.undergroundArea}" pattern="0.00"/>" /><span style="font-weight: normal;"> ㎡</span></b>
					</p>
				</div>
				<div class="style_box">
					<table cellpadding="10" cellspacing="5" class="mytable"
						id="underground">
						<tr>
							<td width="70" class="td-right"><span>公共区域</span></td>
							<td colspan="3"><input type="type"  class="cannotChange" name="undergroundPublicArea" value="<fmt:formatNumber value="${abScale.undergroundPublicArea}" pattern="0.00"/>" />㎡
								&nbsp;&nbsp;&nbsp;&nbsp; 
								<a class="btn btn-danger radius addbtn" id="addUse2" onclick="addTrUse(this)"> 添加用途</a>
							</td>
							<%-- <td width="70"><span>面积</span></td>
							<td colspan="3"><input type="type" id=""
								name="undergroundPublicArea" value="${abScale.undergroundPublicArea}" /> ㎡
								</td> --%>
						</tr>
						<!-- 暂时注释掉 -->
						<%-- <tr>
							<td width="70" class="td-right"><span>车场面积</span></td>
							<td><input type="type" class="cannotChange" name="undergroundPark" value="<fmt:formatNumber value="${abScale.undergroundPark}" pattern="0.00"/>"/>㎡
							</td>
							<td width="70" class="td-right"><span>人防面积</span>
							<td><input type="type" class="cannotChange" name="undergroundRfpark" value="<fmt:formatNumber value="${abScale.undergroundRfpark}" pattern="0.00"/>"/>㎡
							</td>
						</tr> --%>
						
						<c:if test="${not empty requestScope.abScale.undergroundAreaUse }">
		 						<c:forEach var="item" items="${requestScope.abScale.undergroundAreaUse }" varStatus="index">
									<tr>
										<td width="70" class="td-right"><span>用途</span></td>
										<td width="320"><input type="type" name="name1"value="${item.ause}" /></td>
										<td width="70" class="td-right"><span>面积</span>
										<td><input type="type"name="area"value="<fmt:formatNumber value="${item.area}" pattern="#.00"/>"/>㎡
											<input type="hidden" id="entityId_gId" name="ugId" value="${item.id}"/>
											<a data-id="${item.id}" href="javascript:void(0)"onclick="delTrUse(this)"><i class="icon-fullscreen"></i></a>
										</td>
									</tr>
								</c:forEach>
							</c:if>
					</table>
				</div>
				<div style="margin:20px 0px">
					<p>
						<span class="style_btn">园区面积</span> <b class="style_input"><input
							type="type" id="" name="gardenArea" value="<fmt:formatNumber value="${abScale.gardenArea}" pattern="0.00"/>"/><span style="font-weight: normal;"> ㎡</span></b>
					</p>
				</div>
				<!-- 园区面积 -->
				<div class="style_box">
					<table cellpadding="10" cellspacing="5" class="mytable">
						<tr>
							<td width="70" class="td-right"><span>建筑占地</span></td>
							<td width="320"><input type="type" id=""
								name="gardenBuildingArea" value="<fmt:formatNumber value="${abScale.gardenBuildingArea}" pattern="0.00"/>" /> ㎡</td>
							<td width="70" class="td-right"><span>园林占地</span></td>
							<td><input type="type" id="" name="gardenGroveArea" value="<fmt:formatNumber value="${abScale.gardenGroveArea}" pattern="0.00"/>" />
								㎡</td>
						</tr>
						<tr>
							<td width="70" class="td-right"><span>通道占地</span></td>
							<td width="320"><input type="type" id=""
								name="gardenAisleArea" value="<fmt:formatNumber value="${abScale.gardenAisleArea}" pattern="0.00"/>" /> ㎡</td>
							<td width="70" class="td-right"><span>停车占地</span></td>
							<td><input type="type" id="" name="gardenParkArea" value="<fmt:formatNumber value="${abScale.gardenParkArea}" pattern="0.00"/>" />
								㎡</td>
						</tr>
						<tr>
							<td width="70" class="td-right"><span>其他</span></td>
							<td colspan="3"><input type="type" id="otherArea"
								name="otherArea" value="<fmt:formatNumber value="${abScale.otherArea}" pattern="0.00"/>" /> ㎡</td>
						</tr>
					</table>
				</div>
			</div>
		</div>
		<div style="width:100%;text-align:center; padding-top:20px">
			<c:choose>
				<c:when test="${empty requestScope.abScale }">
					<button class="btn btn-danger radius my-btn"
						onclick="saveTotalScale(0)" type="button">提交</button>
					<button class="btn btn-danger radius my-btn"
						onclick="saveTotalScale(1)" type="button">保 存</button>
					<a class="btn btn-default radius" onClick="resetForms('totalScaleAdd');">
						重置 </a>
					<br />
				</c:when>
				<c:otherwise>
					<shiro:hasPermission name="permission:edit">
						<button id="modifyBtn" type="button" class="btn btn-danger radius my-btn"
							onclick="saveTotalScale(3)">启用编辑</button>
						<button class="btn btn-danger radius my-btn hidbtn"
							onclick="saveTotalScale(2)" type="button">保存修改</button>
						<a class="btn btn-default radius hidbtn" onClick="resetForms('totalScaleAdd');">
							重置 </a>	
					</shiro:hasPermission> 
				</c:otherwise>
			</c:choose>
		</div>
		<input type="hidden" id="entityId_absid" name="id" value="${abScale.id }"/><!-- 实体id -->
		<input type="hidden" id="entityId_groundUseArea" name="groundUseArea" value="${abScale.groundUseArea }"/><!-- 外键id -->
		<input type="hidden" id="entityId_undergroundUseArea" name="undergroundUseArea" value="${abScale.undergroundUseArea}"/><!-- 外键id -->
	</div>

	<div style="display:none"></div>
</form>
<script type="text/javascript">
	//计算建筑总面积
	/* function changeAllArea(){
		//获取地上、地下、园区面积相加赋值给总面积
		var groundArea = $("#totalScaleAdd input[name='groundArea']").val();
		var undergroundArea = $("#totalScaleAdd input[name='undergroundArea']").val();
		if(groundArea=="" ||!testNum(groundArea)){
			groundArea=0;
		}
		if(undergroundArea=="" ||!testNum(undergroundArea)){
			undergroundArea=0;
		}
		$("#totalScaleAdd input[name='buildingArea']").val(parseFloat(groundArea)+parseFloat(undergroundArea));
	} */
	function addTrUse(obj) {
		var html = "<tr><td width=\"70\" class=\"td-right\"><span>用途</span></td><td width=\"320\"><input type=\"type\"id=\"\"name=\"name1\"value=\"\"/></td><td width=\"70\" class=\"td-right\"><span>面积</span></td><td><input type=\"type\"id=\"\"name=\"area\"value=\"\"/> ㎡ "
			+ "<a href=\"javascript:void(0)\"onclick=\"delTrUse(this)\"><i class=\"icon-fullscreen\"></i></a></td></tr>";
		$(obj).parent().parent().parent().append(html);
	}
	//存储将要删除的id，传到后台删除
	var delIds = new Array();
	function delTrUse(obj) {
		var id = $(obj).attr("data-id");
		delIds.push(id);
		$(obj).parent().parent().remove();
		layer.msg("点击保存后，将彻底删除该条数据！");
	}
	
	$(function(){
		//js添加地上、地下区域用途数据
		var html = "";
		var ground = $("#ground");
		var underground = $("#underground");
		 /* <c:if test="${not empty requestScope.abScale.groundAreaUse }">
		 	<c:forEach var="item" items="${requestScope.abScale.groundAreaUse}" varStatus="index">
		 		html = "<tr><td width=\"70\"><span>用途</span></td><td width=\"320\"><input type=\"type\"id=\"\"name=\"name1\"value=\"${item.ause}\"/></td><td width=\"70\"><span>面积</span></td><td><input type=\"type\"id=\"\"name=\"area\"value=\"${item.area}\"/> ㎡ "
		 			+ "<input type=\"hidden\" id=\"entityId_gId\" name=\"gId\" value=\"${item.id}\"/><a data-id=\"${item.id}\" href=\"javascript:void(0)\"onclick=\"delTrUse(this)\"><i class=\"icon-fullscreen\"></i></a></td></tr>";
			 	$(ground).append(html);
		 	</c:forEach>
		</c:if>
		<c:if test="${not empty requestScope.abScale.undergroundAreaUse }">
		 	<c:forEach var="item" items="${requestScope.abScale.undergroundAreaUse }" varStatus="index">
		 		html = "<tr><td width=\"70\"><span>用途</span></td><td width=\"320\"><input type=\"type\"id=\"\"name=\"name1\"value=\"${item.ause}\"/></td><td width=\"70\"><span>面积</span></td><td><input type=\"type\"id=\"\"name=\"area\"value=\"${item.area}\"/> ㎡ "
		 			+ "<input type=\"hidden\" id=\"entityId_ugId\" name=\"ugId\" value=\"${item.id}\"/><a data-id=\"${item.id}\"  href=\"javascript:void(0)\"onclick=\"delTrUse(this)\"><i class=\"icon-fullscreen\"></i></a></td></tr>";
			 	$(underground).append(html);
		 	</c:forEach>
		</c:if> */  
		//如果已经保存过了，则开启只读状态
		<c:if test="${not empty requestScope.abScale }">
			$("div").find("input,textarea").attr("readonly",true);
			$("#totalScaleAdd .icon-fullscreen").hide();
			$("#totalScaleAdd .addbtn").attr("disabled",true);
		</c:if>
		
		
 });
	
	
	
</script>
</body>
</html>
